#!/usr/bin/python3
# -*- coding: utf-8 -*-

# *************************************************************************
#    > File Name: model.py
#    > Author: xlzh
#    > Mail: xiaolongzhang2015@163.com
#    > Created Time: 2025年01月14日 星期二 14时21分19秒
# *************************************************************************

from tortoise import fields
from tortoise.models import Model


class PublicModel(Model):
    id = fields.IntField(pk=True, description="sample id")
    access_code = fields.CharField(max_length=63, description="the access code, e.g. SRR002021")
    species = fields.CharField(max_length=63, description="the species of the sample, e.g. Human")
    retrieve_times = fields.IntField(default=0, description="the times retrieved by user")
    file_name = fields.CharField(max_length=63, unique=True, description="the file name, e.g. SRR002021_f1.fq.gz")
    file_size = fields.BigIntField(default=0, description="the file size in byte")
    file_path = fields.CharField(max_length=255, description="the file path in the server")

    class Meta:
        table = "public_file"
        table_description = "table contain all public data"
